package OrderService

import (
	"context"
	toolsDb "gdshop-back-end-go/common/db"
)

// 判断是否是当前会员订单
func IsMyOrder(ctx context.Context, orderId, memberId int) bool {
	count, err := toolsDb.GetUnSafaTable(ctx, "order").Where(
		"id = ? AND member_id = ?", orderId,
		memberId,
	).Fields("1").Count()
	if err != nil {
		return false
	}

	return count > 0
}
